package com.ffcs.resource.config;

import com.ffcs.resource.service.ResourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author ck
 * @date 2024/1/3 15:19
 */
@Component
@Slf4j
public class RunnerLoading implements CommandLineRunner {
    @Autowired
    ResourceService resourceService;

    @Override
    public void run(String... args) throws Exception {
        log.info("初始化项目启动后执行监控资源任务!");
        resourceService.monitorAndAdjust();
    }
}
